You are here: COM API reference > Server objects > IAMRetentionControl interface

IAMRetentionControl interface

Provides a set of properties for use in managing the retention period of documents and tracking security changes made to the retention properties.

Members
Name Description

ExpirationDate property

The date and time the document will expire

RemoveLocalCopy property

Reserved for future use

RestrictedAccessDate property

Reserved for future use

RetentionModified property

The date and time at which the value of any of the previous properties was changed (read-only)

RetentionModifiedBy property

The user name of the user who last changed the value of any of the previous properties (read-only)

Example

The following example code demonstrates how to use the PurgeDocumentWithID method of the AMDocumentRepository objectto purge a list of documents. This example could be modified to present a list of documents for which the ExpirationDate property value has passed:

Private Sub cmdPurge_Click()
    On Error GoTo eh
    ' Update the list
    cmdList_Click
    If lvDocs.ListItems.Count < 1 Then Exit Sub
    
    Dim dr As IAMDocumentRepository13
    Dim i As Long
    
    Set dr = m_vaultLink.CreateVault
        
    'Ask the user if the listed documents are to be purged
    If MsgBox("Are you sure you want to purge all documents before: " & _
             Calendar1.Value, vbYesNo, "Confirm") = vbYes Then
        Screen.MousePointer = vbHourglass
        ' disable controls
        cmdPurge.Enabled = False
        cmdList.Enabled = False
        Calendar1.Visible = False
        
        For i = 1 To lvDocs.ListItems.Count
            'Perform the purge on all listed documents
            dr.PurgeDocumentWithID lvDocs.ListItems.Item(i).Key
            lblNrDocs.Caption = i & " / " & lvDocs.ListItems.Count
            DoEvents
            
            ' Commit transaction for each 30 documents
            If (i Mod 30) = 0 Then
                dr.ReOpen True
            End If
        Next
        Screen.MousePointer = vbDefault
        MsgBox "Done!", , "Document Purger"
    End If
        
    dr.CloseRepository True
    Set dr = Nothing
    
    cmdPurge.Enabled = True
    cmdList.Enabled = True
    Calendar1.Visible = True
    
    Exit Sub
eh:
    Screen.MousePointer = vbDefault
    dr.CloseRepository
    Set dr = Nothing
    MsgBox "Failed: " & Err.Description, , "Document Purger"
End Sub

www.bluecieloecm.com